/**
 *
 *  CheckCommentUserFilter.h
 *
 */

#pragma once

#include <drogon/HttpFilter.h>

#include <drogon/HttpController.h>
#include <drogon/orm/RestfulController.h>

#include <string>
#include <iostream> 

#include "Comment.h"

using namespace drogon;
using namespace drogon_model::REFUSECLASSIFICATION;
using namespace drogon::orm;
using namespace drogon::nosql;

class CheckCommentUserFilter : public HttpFilter<CheckCommentUserFilter> {
  public:
    CheckCommentUserFilter() {}
    virtual void doFilter(const HttpRequestPtr& req,
                          FilterCallback&&      fcb,
                          FilterChainCallback&& fccb) override;

    orm::DbClientPtr getDbClient()
    {
        return drogon::app().getFastDbClient(dbClientName_);
    }

    nosql::RedisClientPtr getRedisClient()
    {
        return drogon::app().getFastRedisClient(redisClientName_);
    }

  protected:
    const std::string dbClientName_{"default"};

    const std::string redisClientName_{"default"};
};
